# Archlive <http://archlive-pkg.googlecode.com>

pkgname=tiacx-2.6.32
_kernver=2.6.32-ARCH
pkgver=20080210
pkgrel=11
pkgdesc="OpenSource module for Texas Instruments ACX100/ACX111 wireless chips. For stock arch 2.6 kernel"
arch=(i686 x86_64)
url="http://acx100.sourceforge.net/"
license=('MPL')
depends=('wireless_tools' 'kernel26>=2.6.32' 'kernel26<2.6.33' 'tiacx-firmware')
install=acx.install
source=(http://downloads.sourceforge.net/sourceforge/acx100/acx-$pkgver.tar.bz2
        kernel-2.6.27.patch
        kernel-2.6.30.patch
        kernel-2.6.31.patch)

build() {
    cd $startdir/src/acx-$pkgver
    patch -Np1 -i ../kernel-2.6.27.patch || return 1
    patch -Np0 -i ../kernel-2.6.30.patch || return 1
    patch -Np1 -i ../kernel-2.6.31.patch || return 1
    make -C /lib/modules/${_kernver}/build M=`pwd` || return 1
    install -D acx.ko $startdir/pkg/lib/modules/${_kernver}/kernel/drivers/net/wireless/tiacx/acx.ko
    sed -i -e "s/KERNEL_VERSION='.*'/KERNEL_VERSION='${_kernver}'/" $startdir/*.install
}
